package thermologic.gui;

import javax.swing.DefaultComboBoxModel;
import thermologic.core.Channel;

/**
 *
 * @author mrivadeneira
 */
public class ChannelListModel extends DefaultComboBoxModel
{
    private Channel[] channels;

    public ChannelListModel()
    {
    }

    public void setChannels(Channel[] channels)
    {
        this.channels = channels;
    }
    
    
    @Override
    public int getSize()
    {
        int size = 0;
        
        if(channels != null)
        {
            size = channels.length; 
        }
        
        return size;
    }

    @Override
    public Object getElementAt(int index)
    {
        Channel channel = null;
        
        if(channels != null)
        {
            channel = channels[index];
        }
        
        return channel;
    }
    
}
